Skip to content

implement dclogin scheme#3541

Merged
r10s merged 14 commits into
masterfrom
dclogin_scheme
Sep 29, 2022
Merged

implement dclogin scheme#3541
r10s merged 14 commits into
masterfrom
dclogin_scheme

Conversation

@Simon-Laux

@Simon-Laux Simon-Laux commented Aug 4, 2022

Copy link
Copy Markdown
Member

see deltachat/interface#48 for the specification.

progress

deltachat.h

  • constants
  • documentation (lot/function)

implementation

  • parsing
  • test parsing
  • have a test for usename+extension@host cases
  • apply/action
  • test apply/action (test from qr method)
  • lot text1

bindings

  • node bindings constants
  • jsonrpc qr type
  • python?

@Hocuri Hocuri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I noticed that I don't know much (and don't have much of an opinion) about QR codes, so I ended up looking at the code style mainly. Which is nice, in the "big picture", since most of the new complexity could be put into one new file.

Comment thread src/qr.rs
Comment thread src/qr/dclogin_scheme.rs Outdated
Comment thread src/qr/dclogin_scheme.rs Outdated
Comment thread src/qr/dclogin_scheme.rs Outdated
Comment thread src/qr/dclogin_scheme.rs Outdated
Comment thread src/qr/dclogin_scheme.rs Outdated
Comment thread src/qr/dclogin_scheme.rs
Comment thread src/qr/dclogin_scheme.rs
Comment thread src/qr/dclogin_scheme.rs Outdated
Ok(())
}

// idea: should invalid uri encoding result in error?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, what else?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is one of these todo points I was to lazy to tackle or did not immediately know how to or did not know if its worth the effort. anyways I don't really care, if you think such a test could be useful feel free to try making one 🤷

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so, either create a test or remove the comment. i do not think someone else will pick this task up by a random comment, that tends to be misunderstood months later.

Comment thread src/qr.rs
@Hocuri

Hocuri commented Aug 30, 2022

Copy link
Copy Markdown
Collaborator

Just so we're on the same page, my understanding is that this is waiting for @Simon-Laux to fix the CI and fix my remaining comments (or comment that/why he doesn't think this can/should be changed). Or @Simon-Laux would you like to hand this off to someone else?

@Simon-Laux

Simon-Laux commented Aug 30, 2022

Copy link
Copy Markdown
Member Author

@r10s wanted to review it, but he also kept telling me how that isn't a priority for the 1.32 release, which should be out by now. anyhow I'm a bit confused here.

Anyways I'm not against handing this over as long as the spec doesn't change and it still works afterwards.
I'm only against:

  • wildcard config values (taking every possible config value, we could do such things maybe in a second version (in the version property), but even then I like the thing being well documented and future backwards compatible)
  • removing the version property

@r10s r10s left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ci is also still unhappy :)

i made my points that i find the ::V1 bloated, we can add that later if really needed, esp. if we check for a version parameter (checking does not even require the parameter added to the qr code btw)

but i am also pretty sure that whatever addition we need in the future, we can go without ::V2 in the code. having a ::V2 and leaving ::V1 easily leads to legacy code lying around for rare cases, including possible bugs, potentially waiting for being misused. why already prepare this pattern without need?

but well, if everyone else is happy with ::V1, then so be it :) in general, the pr looks good to me, nice!

@Simon-Laux

Copy link
Copy Markdown
Member Author

easily leads to legacy code lying around for rare cases, including possible bugs, potentially waiting for being misused. why already prepare this pattern without need?

it is an documented interface to the outside, we don't control the creating of the qr codes,
so if for example a provider once happens to implement V1 and then don't bother anymore when we bring out V2,
then if we don't support V1 anymore, then there is an qr code for dc on the provider, but you can't scan it because in theory the provider would need to update to V2 or you have to downgrade DC (no normal user will downgrade DC ever).

I personally think the forwards and backwards compatibility is worth it.

With having a different version or variant, we can make certain parameters required and ensure the user scans it with a version of delta chat that supports it fully.

V2 could also just be same as V1 just with videochat and a fileserver required for example, so the V1 would not even get obsolete.

@r10s

r10s commented Sep 2, 2022

Copy link
Copy Markdown
Contributor

it is an documented interface to the outside, we don't control the creating of the qr codes,

sure. i think, no one has misunderstood that.

i just pointed out different, maybe easier and safer approaches - while still having the option for forwards and backwards compatibility - but i also pointed out that i do not see the current implementation as a blocker :)

Comment thread deltachat-ffi/deltachat.h
Comment thread src/qr/dclogin_scheme.rs Outdated

@r10s r10s left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rustfmt is unhappy and the comment "test idea" should be removed - or, better, a test added :)

@Simon-Laux

Simon-Laux commented Sep 28, 2022

Copy link
Copy Markdown
Member Author

or, better, a test added :)

sure, but I don't have a head for this anytime soon. Also it's kinda a theoretical problem anyway, In the sense that it is nice to have, but in the end it's up to the users to follow the spec.

@r10s r10s merged commit 110f567 into master Sep 29, 2022
@r10s r10s deleted the dclogin_scheme branch September 29, 2022 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants